/*
* BlackList
* Reads from file a list of websites to be blocked
* If a website is found in the BlackList then its content will be blocked
*
* Cassie Chin, Stephen Smetana, Logan Widick
* CSCE 3530 Program 2
*/

#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

/*
* Blacklisted
* A Blacklisted is an item in a list of urls that will be blocked.
*/
typedef struct Blacklisted {
  char *url;
  struct Blacklisted *ptr2next;
} Blacklisted;

/**
 * Prints out the list of all websites being blacklisted.
 *
 * @param blackListHead This is the first node in the blacklist.
 */
void printBlacklist(Blacklisted * blackListHead); 

/**
 * Checks to see if the userString is an item in the Blacklist
 * 
 * @param blackListHead This is the first node in the blacklist.
 * @param userString This is the string 
 */
int isThisBlacklisted(Blacklisted * blackListHead, char * userString);

/**
 * Created the Linked Blacklist and adds elements into it. 
 *
 * @param file_input The file containing the list of websites to block.
 */
Blacklisted *new_Blacklisted(FILE *file_input); 

/**
 * Blacklist destructor
 *
 * @param listed This is the first node in the blacklist to delete.
 */
void delete_Blacklisted(Blacklisted *listed);

